// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_TECHNIC_COST
// * CreateDate    : 2014-06-05 18:30:21
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:21
// * LastChanger   : 2014-06-05 18:30:21
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class ProdTechnicCostEntity : EntityBase
    {
        public ProdTechnicCostTable TableSchema
        {
            get
            {
                return ProdTechnicCostTable.Current;
            }
		}
		
		public ProdTechnicCostEntity()
        {

        }
		
		public ProdTechnicCostEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.TechnicId = Convert.ToString(CommonFunctions.ToObject(dr["TECHNIC_ID"]));
			this.Cost = Convert.ToDecimal(CommonFunctions.ToObject(dr["COST"]));
			this.ValidityDateFrom = Convert.ToDateTime(CommonFunctions.ToObject(dr["VALIDITY_DATE_FROM"]));
			this.ValidityDateTo = Convert.ToDateTime(CommonFunctions.ToObject(dr["VALIDITY_DATE_TO"]));
			this.ValidityFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["VALIDITY_FLAG"]));
        }
		
		public ProdTechnicCostEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.TechnicId = Convert.ToString(CommonFunctions.ToObject(dr["TECHNIC_ID"]));
			this.Cost = Convert.ToDecimal(CommonFunctions.ToObject(dr["COST"]));
			this.ValidityDateFrom = Convert.ToDateTime(CommonFunctions.ToObject(dr["VALIDITY_DATE_FROM"]));
			this.ValidityDateTo = Convert.ToDateTime(CommonFunctions.ToObject(dr["VALIDITY_DATE_TO"]));
			this.ValidityFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["VALIDITY_FLAG"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ProdTechnicCostTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(ProdTechnicCostTable.C_ID)); }
            set { SetData(ProdTechnicCostTable.C_ID, value); }
        }
		
        [DataMember]
        public string TechnicId
        {
            get { return Convert.ToString(GetData(ProdTechnicCostTable.C_TECHNIC_ID)); }
            set { SetData(ProdTechnicCostTable.C_TECHNIC_ID, value); }
        }
		
        [DataMember]
        public decimal Cost
        {
            get { return Convert.ToDecimal(GetData(ProdTechnicCostTable.C_COST)); }
            set { SetData(ProdTechnicCostTable.C_COST, value); }
        }
		
        [DataMember]
        public DateTime ValidityDateFrom
        {
            get { return Convert.ToDateTime(GetData(ProdTechnicCostTable.C_VALIDITY_DATE_FROM)); }
            set { SetData(ProdTechnicCostTable.C_VALIDITY_DATE_FROM, value); }
        }
		
        [DataMember]
        public DateTime ValidityDateTo
        {
            get { return Convert.ToDateTime(GetData(ProdTechnicCostTable.C_VALIDITY_DATE_TO)); }
            set { SetData(ProdTechnicCostTable.C_VALIDITY_DATE_TO, value); }
        }
		
        [DataMember]
        public int ValidityFlag
        {
            get { return Convert.ToInt32(GetData(ProdTechnicCostTable.C_VALIDITY_FLAG)); }
            set { SetData(ProdTechnicCostTable.C_VALIDITY_FLAG, value); }
        }
		
		#endregion
	}
	
	
}	

